﻿using System;
using System.Collections.Generic;

namespace Mvvm.Models;

public class ChatConversation
{
    private DateTime StartTime { get; set; }
    private DateTime EndTime { get; set; }
    private TimeSpan Duration { get; set; }
    private List<DateTime> TimeArray { get; set; } = new List<DateTime>();
    
    private List<String> UserArray  { get; set; } = new List<String>();
    
    public ChatConversation(DateTime startTime)
    {
        StartTime = startTime;
    }

    public void addTime(DateTime time, String user)
    {
        TimeArray.Add(time);
        UserArray.Add(user);
    }

    public void endConversation()
    {
        EndTime = TimeArray[TimeArray.Count - 1];
        Duration = EndTime - StartTime;
    }

    public TimeSpan getDuration()
    {
        return Duration;
    }

    public List<DateTime> getTimeArray()
    {
        return TimeArray;
    }

    public List<String> getUserArray()
    {
        return UserArray;
    }

    public DateTime getStartTime()
    {
        return StartTime;
    }

    public DateTime getEndTime()
    {
        return EndTime;
    }
}